<?php

namespace app\api\controller;

use app\api\controller\Base;
use think\facade\Request;
use app\activityNew\model\ImsEweiShopActivity;
use app\activityNew\model\ImsEweiShopAd;

class Ad extends Base
{
    public function index()
    {
        echo "api index";
    }

    public function getad()
    {
        $limit = $this->request->get('limit',10);
        $page = $this->request->get('page',1);
        $offset = ($page - 1) * $limit;

        $where = ['actstatus'=>1,'delete'=>0];
        $ad_list = ImsEweiShopActivity::mk()->where($where)->limit($offset,$limit)->select();
        $this->echojson(0,'活动列表', $ad_list);
    }

    public function getadImg()
    {
        $limit = $this->request->get('limit',10);
        $page = $this->request->get('page',1);
        $offset = ($page - 1) * $limit;

        $where = ['status'=>1,'delete'=>0];
        $ad_list = ImsEweiShopAd::mk()->where($where)->limit($offset,$limit)->select();
        $this->echojson(0,'广告列表', $ad_list);
    }

}
